﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;

//登陆界面
public class Login : MonoBehaviour
{
    private InputField _inputAccount;
    private InputField _inputPassword;
    private Button _btnOK;

    void Awake()
    {
        _inputAccount = gameObject.Find<InputField>("InputAccount");
        //_inputAccount = transform.Find
        //    ("InputAccount").GetComponent<InputField>();
        _inputAccount = transform.Find
            ("InputPassword").GetComponent<InputField>();
        _btnOK = transform.Find("BtnLogin").GetComponent<Button>();

        _btnOK.onClick.AddListener(onBtnOKClick);
    }

    private void onBtnOKClick()
    {
        //连接服务器，等待返回数据
        //暂时用假数据，直接进选人界面
        SceneManager.LoadScene("SelectRole");
    }

    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}
